public class replace {
    //需求：替换敏感词
    public static void main(String[] args) {
        //1.声明一句敏感词
        String talk="你玩的好菜，TMD，SB";
        //2.声明一个敏感词库
        String[] arr={"TMD","SB","CNM"};
        //3.利用方法进行替换
        for (int i = 0; i < arr.length; i++) {
            talk=talk.replace(arr[i],"***");
        }
        System.out.println(talk);
    }
}
